package net.viservice.mysql.backup;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.JobKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PrintTimeJob implements Job {

	private static final Logger logger = LoggerFactory.getLogger(PrintTimeJob.class);
	private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
	
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		JobKey jobKey = context.getJobDetail().getKey();
		String currentTime = sdf.format(new Date());
		
		logger.info(jobKey.toString() + " ---> currentTime:" + currentTime + ",fireTime" + context.getFireTime());
	}

}
